// *****************************************************************************
// Copyright (c) 2005 - 2017 Qualcomm Technologies International, Ltd.
// %%version
//
// *****************************************************************************

#include "aac_library.h"
#include "core_library.h"

#ifdef AACDEC_PS_ADDITIONS

// *****************************************************************************
// MODULE:
//    $aacdec.ps_decorrelation_tables
//
// DESCRIPTION:
//    - decorrelation tables that will go into flash
//
// *****************************************************************************

.BLOCK/DMCONST_WINDOWED16 ps_decorrelation;

   .VAR ps_phi_fract_hybrid_bands_real[] =
            32384,     29370,     23621,     15673,     32768,     32768,     29370,     32384,    -17775,      1286,    -30371,    -31922;


   .VAR ps_phi_fract_hybrid_bands_imag[] =
            -4999,    -14531,    -22711,    -28777,         0,         0,     14531,      4999,    -27528,    -32743,    -12302,      7399;


   .VAR ps_phi_fract_allpass_hybrid_bands_real[] =
             32302,  31357,  32464,  28653,  20788,  30068,  21766,   3212,  25452,   12421, -15447,  18957,
             32768,  32768,  32768,  32768,  32768,  32768,  28653,  20788,  30068,   32302,  31357,  32464,
            -23352, -18205, -10833,  -3851, -32138,   6771, -32597,  18205, -25297,  -27528,  32138, -32430;


   .VAR ps_phi_fract_allpass_hybrid_bands_imag[] =
             -5507,  -9512,  -4451, -15899, -25330, -13026, -24494, -32610, -20638,  -30323, -28899, -26727,
                 0,      0,      0,      0,      0,      0,  15899,  25330,  13026,    5507,   9512,   4451,
            -22988,  27246, -30926, -32541,  -6393, -32061,  -3340,  27246, -20828,   17775,  -6393,  -4693;


   .VAR ps_phi_fract_qmf_bands_real[] =
             26809,       -8647,      -32667,      -13485,       23532,       29427,       -3596,      -31863,      -17990,       19675,       31319,        1544,      -30274,
            -22053,       15333,       32441,        6645,      -27939,      -25573,       10614,       32764,       11583,      -24917,      -28463,        5634,       32280,
             16235,      -21281,      -30653,         515,       31001,       20488,      -17121,      -32087,       -4617,       28959,       24236,      -12540,      -32732,
             -9635,       26204,       27388,       -7650,      -32570,      -14416,       22804,       29865,       -2571,      -31607,      -18842,       18842,       31607,
              2571,      -29865,      -22804,       14416,       32570,        7650,      -27388,      -26204,        9635,       32732,       12540,      -24236;

   .VAR ps_phi_fract_qmf_bands_imag[] =
            -18842,      -31607,       -2571,       29865,       22804,      -14416,      -32570,       -7650,       27388,       26204,       -9635,      -32732,      -12540,
             24236,       28959,       -4617,      -32087,      -17121,       20488,       31001,         515,      -30653,      -21281,       16235,       32280,        5634,
            -28463,      -24917,       11583,       32764,       10614,      -25573,      -27939,        6645,       32441,       15333,      -22053,      -30274,        1544,
             31319,       19675,      -17990,      -31863,       -3596,       29427,       23532,      -13485,      -32667,       -8647,       26809,       26809,       -8647,
            -32667,      -13485,       23532,       29427,       -3596,      -31863,      -17990,       19675,       31319,        1544,      -30274,      -22053;



   .VAR g_decay_slope_filter_20_parameter_bands_qmf_bands_table [] =
             21346,       18504,       16041,       20279,       17579,       15239,       19211,       16654,       14437,       18144,       15728,       13635,
             17077,       14803,       12833,       16009,       13878,       12030,       14942,       12953,       11228,       13875,       12028,       10426,
             12807,       11102,        9624,       11740,       10177,        8822,       10673,        9252,        8020,        9605,        8327,        7218,
              8538,        7401,        6416,        7471,        6476,        5614,        6403,        5551,        4812,        5336,        4626,        4010,
              4269,        3700,        3208,        3201,        2775,        2406,        2134,        1850,        1604,        1067,         925,         802;


   // can remove first three frequencies -- and only need upto k = 22 !!
   .VAR ps_phi_fract_allpass_qmf_bands_real[] =
          25573,   12540,   28020,      -14416,  -30274,   -2109,      -31863,   30274,  -29970,         515,  -12540,  -25605,
          32087,  -12540,    6292,       13484,   30274,   31423,      -26204,  -30274,   22767,      -24917,   12540,  -10370,
          15333,   12540,  -32356,       31607,  -30274,  -19551,       -1544,   30274,   14277,      -32280,  -12540,   32753,
         -12540,  -12540,   16011,       26809,   30274,  -17947,       24236,  -30274,  -32608,      -16235,   12540,  -12206,
         -31319,   12540,   21320,        2571,  -30274,   31922,       32441,   30274,    8199,       11583,  -12540,  -24340,
         -27388,  -12540,  -30707,      -23532,   30274,   -4056,       17121,  -30274,   26956,       31001,   12540,   28983,
          -3596,   12540,    -154,      -32570,  -30274,  -29126,      -10614,   30274,  -26779,       27939,  -12540,    4362,
          22804,  -12540,   30813,      -17990,   30274,   24132,      -30653,  -30274,   -8498,        4617,   12540,  -31990,
          32667,   12540,  -21085,        9635,  -30274,   12492,      -28463,   30274,   32637,      -22053,  -12540,   17688,
          18842,  -12540,  -16280,       30274,   30274,  -32743,       -5634,  -30274,  -13998,      -32732,   12540,   19798,
          -8647,   12540,   32306,       28959,  -30274,   10077,       21281,   30274,  -22988,      -19675,  -12540,  -31335,
         -29865,  -12540,   -5988,        6645,   30274,   25797,       32764,  -30274,   29844,        7650,   12540,    1801,
         -29427,   12540,  -28179,      -20488,  -30274,  -27858,       20488,   30274,    2417,       29427,  -12540,   30093,
          -7650,  -12540,   25411,      -32764,   30274,   -6595,       -6645,  -30274,  -31510,       29865,   12540,  -22544,
          19675,   12540,   10663,      -21281,  -30274,   32404,      -28959,   30274,   19302,        8647,  -12540,  -14554,
          32732,  -12540,  -32761,        5634,   30274,  -15741,      -30274,  -30274,   18205,      -18842,   12540,   32576;


   .VAR ps_phi_fract_allpass_qmf_bands_imag[] =
         -20488,  -30274,  -16989,      -29427,   12540,  -32700,        7650,   12540,  -13250,       32764,  -30274,   20448,
           6645,   30274,   32158,      -29865,  -12540,    9290,      -19675,  -12540,  -23567,       21281,   30274,  -31084,
          28959,  -30274,   -5177,       -8647,   12540,   26296,      -32732,   12540,   29494,       -5634,  -30274,     978,
          30274,   30274,  -28590,       18842,  -12540,  -27416,      -22053,  -12540,    3237,      -28463,   30274,   30410,
           9635,  -30274,   24884,       32667,   12540,   -7399,        4617,   12540,  -31726,      -30653,  -30274,  -21939,
         -17990,   30274,   11438,       22804,  -12540,   32516,       27939,  -12540,   18631,      -10614,   30274,  -15288,
         -32570,  -30274,  -32768,       -3596,   12540,  -15014,       31001,   12540,   18884,       17121,  -30274,   32476,
         -23532,   30274,   11148,      -27388,  -12540,  -22167,       11583,  -12540,  -31647,       32441,   30274,   -7098,
           2571,  -30274,   25083,      -31319,   12540,   30293,      -16235,   12540,    2930,       24236,  -30274,  -27584,
          26809,   30274,  -28438,      -12540,  -12540,    1286,      -32280,  -12540,   29627,       -1544,   30274,   26111,
          31607,  -30274,   -5482,       15333,   12540,  -31180,      -24917,   12540,  -23352,      -26204,  -30274,    9586,
          13485,   30274,   32216,       32087,  -12540,   20206,         515,  -12540,  -13531,      -31863,   30274,  -32718,
         -14416,  -30274,  -16725,       25573,   12540,   17253,       25573,   12540,   32679,      -14416,  -30274,   12966,
         -31863,   30274,  -20688,         515,  -12540,  -32098,       32087,  -12540,   -8994,       13484,   30274,   23781,
         -26204,  -30274,   30985,      -24917,   12540,    4872,       15333,   12540,  -26480,       31607,  -30274,  -29358,
          -1544,   30274,    -669,      -32280,  -12540,   28740,      -12540,  -12540,   27246,       26809,   30274,   -3545;

.ENDBLOCK;

#endif
